home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Folders.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  9.7 KB  |  258 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Folders.p
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Folders;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __FOLDERS__}
  28. {$SETC __FOLDERS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC FoldersIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43.  
  44. CONST
  45.     kOnSystemDisk                = $8000;
  46.  
  47.     kCreateFolder                = 1;
  48.     kDontCreateFolder            = 0;
  49.  
  50.     kSystemFolderType            = 'macs';                        {  the system folder  }
  51.     kDesktopFolderType            = 'desk';                        {  the desktop folder; objects in this folder show on the desk top.  }
  52.     kTrashFolderType            = 'trsh';                        {  the trash folder; objects in this folder show up in the trash  }
  53.     kWhereToEmptyTrashFolderType = 'empt';                        {  the "empty trash" folder; Finder starts empty from here down  }
  54.     kPrintMonitorDocsFolderType    = 'prnt';                        {  Print Monitor documents  }
  55.     kStartupFolderType            = 'strt';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here  }
  56.     kShutdownFolderType            = 'shdf';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here  }
  57.     kAppleMenuFolderType        = 'amnu';                        {  Finder objects to put into the Apple menu go here  }
  58.     kControlPanelFolderType        = 'ctrl';                        {  Control Panels go here (may contain INITs)  }
  59.     kExtensionFolderType        = 'extn';                        {  Finder extensions go here  }
  60.     kFontsFolderType            = 'font';                        {  Fonts go here  }
  61.     kPreferencesFolderType        = 'pref';                        {  preferences for applications go here  }
  62.     kTemporaryFolderType        = 'temp';                        {  temporary files go here (deleted periodically, but don't rely on it.)  }
  63.  
  64. {
  65.     Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  66.             while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  67.             Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  68. }
  69. {$IFC NOT UNDEFINED USE_FINDFOLDER_GLUE }
  70. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  71. {$ELSEC}
  72. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  73.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  74.     INLINE $7000, $A823;
  75.     {$ENDC}
  76. {$ENDC}
  77.  
  78. FUNCTION ReleaseFolder(vRefNum: INTEGER; folderType: OSType): OSErr;
  79.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  80.     INLINE $700B, $A823;
  81.     {$ENDC}
  82.  
  83. {****************************************}
  84. { Extensible Folder Manager declarations }
  85. {****************************************}
  86.  
  87. {**************************}
  88. { Folder Manager constants }
  89. {**************************}
  90.  
  91. { new Folder Manager error codes }
  92.  
  93. CONST
  94.     badFolderDescErr            = -4270;
  95.     duplicateFolderDescErr        = -4271;
  96.     noMoreFolderDescErr            = -4272;
  97.     invalidFolderTypeErr        = -4273;
  98.     duplicateRoutingErr            = -4274;
  99.     routingNotFoundErr            = -4275;
  100.     badRoutingSizeErr            = -4276;
  101.  
  102.  
  103.     kExtensionDisabledFolderType = 'extD';
  104.     kControlPanelDisabledFolderType = 'ctrD';
  105.     kSystemExtensionDisabledFolderType = 'macD';
  106.     kStartupItemsDisabledFolderType = 'strD';
  107.     kShutdownItemsDisabledFolderType = 'shdD';
  108.     kApplicationsFolderType        = 'apps';
  109.     kDocumentsFolderType        = 'docs';
  110.  
  111.                                                                 {  new constants  }
  112.     kVolumeRootFolderType        = 'root';                        {  root folder of a volume  }
  113.     kChewableItemsFolderType    = 'flnt';                        {  items deleted at boot  }
  114.     kApplicationSupportFolderType = 'asup';                        {  third-party items and folders  }
  115.     kTextEncodingsFolderType    = 'ƒtex';                        {  encoding tables  }
  116.     kStationeryFolderType        = 'odst';                        {  stationery  }
  117.     kOpenDocFolderType            = 'odod';                        {  OpenDoc root  }
  118.     kOpenDocShellPlugInsFolderType = 'odsp';                    {  OpenDoc Shell Plug-Ins in OpenDoc folder  }
  119.     kEditorsFolderType            = 'oded';                        {  OpenDoc editors in MacOS Folder  }
  120.     kOpenDocEditorsFolderType    = 'ƒodf';                        {  OpenDoc subfolder of Editors folder  }
  121.     kOpenDocLibrariesFolderType    = 'odlb';                        {  OpenDoc libraries folder  }
  122.     kGenEditorsFolderType        = 'ƒedi';                        {  CKH general editors folder at root level of Sys folder  }
  123.     kHelpFolderType                = 'ƒhlp';                        {  CKH help folder currently at root of system folder  }
  124.     kInternetPlugInFolderType    = 'ƒnet';                        {  CKH internet plug ins for browsers and stuff  }
  125.     kModemScriptsFolderType        = 'ƒmod';                        {  CKH modem scripts, get 'em OUT of the Extensions folder  }
  126.     kPrinterDescriptionFolderType = 'ppdf';                        {  CKH new folder at root of System folder for printer descs.  }
  127.     kPrinterDriverFolderType    = 'ƒprd';                        {  CKH new folder at root of System folder for printer drivers  }
  128.     kScriptingAdditionsFolderType = 'ƒscr';                        {  CKH at root of system folder  }
  129.     kSharedLibrariesFolderType    = 'ƒlib';                        {  CKH for general shared libs.  }
  130.     kVoicesFolderType            = 'fvoc';                        {  CKH macintalk can live here  }
  131.     kControlStripModulesFolderType = 'sdev';                    {  CKH for control strip modules  }
  132.     kAssistantsFolderType        = 'astƒ';                        {  SJF for Assistants (MacOS Setup Assistant, etc)  }
  133.     kUtilitiesFolderType        = 'utiƒ';                        {  SJF for Utilities folder  }
  134.     kAppleExtrasFolderType        = 'aexƒ';                        {  SJF for Apple Extras folder  }
  135.     kContextualMenuItemsFolderType = 'cmnu';                    {  SJF for Contextual Menu items  }
  136.     kMacOSReadMesFolderType        = 'morƒ';                        {  SJF for MacOS ReadMes folder  }
  137.     kALMModulesFolderType        = 'walk';                        {  EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType)  }
  138.     kALMPreferencesFolderType    = 'trip';                        {  EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType)  }
  139.     kALMLocationsFolderType        = 'fall';                        {  EAS for Location Manager Locations (within kALMPreferencesFolderType)  }
  140.  
  141.  
  142. { FolderDescFlags values }
  143.     kCreateFolderAtBoot            = $00000002;
  144.     kFolderCreatedInvisible        = $00000004;
  145.     kFolderCreatedNameLocked    = $00000008;
  146.  
  147.  
  148. TYPE
  149.     FolderDescFlags                        = UInt32;
  150. { FolderClass values }
  151.  
  152. CONST
  153.     kRelativeFolder                = 'relf';
  154.     kSpecialFolder                = 'spcf';
  155.  
  156.  
  157. TYPE
  158.     FolderClass                            = OSType;
  159. { special folder locations }
  160.  
  161. CONST
  162.     kBlessedFolder                = 'blsf';
  163.     kRootFolder                    = 'rotf';
  164.  
  165.  
  166. TYPE
  167.     FolderType                            = OSType;
  168.     FolderLocation                        = OSType;
  169.  
  170.     FolderDescPtr = ^FolderDesc;
  171.     FolderDesc = RECORD
  172.         descSize:                Size;
  173.         foldType:                FolderType;
  174.         flags:                    FolderDescFlags;
  175.         foldClass:                FolderClass;
  176.         foldLocation:            FolderType;
  177.         badgeSignature:            OSType;
  178.         badgeType:                OSType;
  179.         reserved:                UInt32;
  180.         name:                    Str63;
  181.     END;
  182.  
  183.  
  184.     RoutingFlags                        = UInt32;
  185.     FolderRoutingPtr = ^FolderRouting;
  186.     FolderRouting = RECORD
  187.         descSize:                Size;
  188.         fileType:                OSType;
  189.         routeFromFolder:        FolderType;
  190.         routeToFolder:            FolderType;
  191.         flags:                    RoutingFlags;
  192.     END;
  193.  
  194. { routing constants }
  195. {*************************}
  196. { Folder Manager routines }
  197. {*************************}
  198. { Folder Manager administration routines }
  199. FUNCTION AddFolderDescriptor(foldType: FolderType; flags: FolderDescFlags; foldClass: FolderClass; foldLocation: FolderLocation; badgeSignature: OSType; badgeType: OSType; name: ConstStr63Param; replaceFlag: BOOLEAN): OSErr;
  200.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  201.     INLINE $7020, $A823;
  202.     {$ENDC}
  203. FUNCTION GetFolderDescriptor(foldType: FolderType; descSize: Size; VAR foldDesc: FolderDesc): OSErr;
  204.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  205.     INLINE $7023, $A823;
  206.     {$ENDC}
  207. FUNCTION GetFolderTypes(requestedTypeCount: UInt32; VAR totalTypeCount: UInt32; VAR theTypes: FolderType): OSErr;
  208.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  209.     INLINE $7024, $A823;
  210.     {$ENDC}
  211. FUNCTION RemoveFolderDescriptor(foldType: FolderType): OSErr;
  212.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  213.     INLINE $7021, $A823;
  214.     {$ENDC}
  215. { legacy routines }
  216. FUNCTION GetFolderName(vRefNum: INTEGER; foldType: OSType; VAR foundVRefNum: INTEGER; VAR name: Str63): OSErr;
  217.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  218.     INLINE $700E, $A823;
  219.     {$ENDC}
  220. { routing routines }
  221. FUNCTION AddFolderRouting(fileType: OSType; routeFromFolder: FolderType; routeToFolder: FolderType; flags: RoutingFlags; replaceFlag: BOOLEAN): OSErr;
  222.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  223.     INLINE $7026, $A823;
  224.     {$ENDC}
  225. FUNCTION RemoveFolderRouting(fileType: OSType; routeFromFolder: FolderType): OSErr;
  226.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  227.     INLINE $7027, $A823;
  228.     {$ENDC}
  229. FUNCTION FindFolderRouting(fileType: OSType; routeFromFolder: FolderType; VAR routeToFolder: FolderType; VAR flags: RoutingFlags): OSErr;
  230.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  231.     INLINE $7022, $A823;
  232.     {$ENDC}
  233. FUNCTION GetFolderRoutings(requestedRoutingCount: UInt32; VAR totalRoutingCount: UInt32; routingSize: Size; VAR theRoutings: FolderRouting): OSErr;
  234.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  235.     INLINE $701E, $A823;
  236.     {$ENDC}
  237. FUNCTION InvalidateFolderDescriptorCache(vRefNum: INTEGER; dirID: LONGINT): OSErr;
  238.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  239.     INLINE $7025, $A823;
  240.     {$ENDC}
  241. FUNCTION IdentifyFolder(vRefNum: INTEGER; dirID: LONGINT; VAR foldType: FolderType): OSErr;
  242.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  243.     INLINE $701F, $A823;
  244.     {$ENDC}
  245.  
  246.  
  247.  
  248. {$ALIGN RESET}
  249. {$POP}
  250.  
  251. {$SETC UsingIncludes := FoldersIncludes}
  252.  
  253. {$ENDC} {__FOLDERS__}
  254.  
  255. {$IFC NOT UsingIncludes}
  256.  END.
  257. {$ENDC}
  258.